X-Git-Url: http://git.cyclocoop.org//%22http:/%22.attribut_html%28%24lesurls%5B%24numero%5D%29.%22/%22?a=blobdiff_plain;f=languages%2FLanguageConverter.php;h=f611358d94c09b5e2faa3d91b05b297cfccb397e;hb=1ce52c41fcef3cb6fc8dba10ad3a6d570373d8bd;hp=1f720af26c664028848b770cbb740b35c4c14da7;hpb=76d072e4813b8d28630d7a3768bccc37bf54f7f5;p=lhc%2Fweb%2Fwiklou.git diff --git a/languages/LanguageConverter.php b/languages/LanguageConverter.php index 1f720af26c..f611358d94 100644 --- a/languages/LanguageConverter.php +++ b/languages/LanguageConverter.php @@ -39,6 +39,7 @@ class LanguageConverter { */ static public $languagesWithVariants = [ 'en', + 'crh', 'gan', 'iu', 'kk', @@ -162,6 +163,8 @@ class LanguageConverter { $req = $this->getURLVariant(); + Hooks::run( 'GetLangPreferredVariant', [ &$req ] ); + if ( $wgUser->isSafeToLoad() && $wgUser->isLoggedIn() && !$req ) { $req = $this->getUserVariant(); } elseif ( !$req ) { @@ -679,9 +682,8 @@ class LanguageConverter { $noScript = '.*?<\/script>(*SKIP)(*FAIL)'; $noStyle = '.*?<\/style>(*SKIP)(*FAIL)'; - // @codingStandardsIgnoreStart Generic.Files.LineLength.TooLong + // phpcs:ignore Generic.Files.LineLength $noHtml = '<(?:[^>=]*+(?>[^>=]*+=\s*+(?:"[^"]*"|\'[^\']*\'|[^\'">\s]*+))*+[^>=]*+>|.*+)(*SKIP)(*FAIL)'; - // @codingStandardsIgnoreEnd while ( $startPos < $length && $continue ) { $continue = preg_match( // Only match -{ outside of html.